#coding=utf-8

exec('from applications.%s.modules.pysip import Sip' % request.application)

APPKEY = '25901'
CERTCODE = '6e1ce7a030dc11dea751cefd64740030'
SIPSESSIONID = response.session_id  # by web2py
APPLICATIONNAME = "爱开店 - 秀"
MY_ALISOFT_URL = 'http://mall.alisoft.com/apps/shopwindow/showAppDetailAction!view.jspa?appID='+APPKEY
HOST='http://'+request.env.http_host
sip = Sip(APPKEY, CERTCODE, SIPSESSIONID)


## 打算分离2个应用，对不同的账号分别认证，不过看来是自找麻烦！！
#IKAIDIAN = ['default',]
#ITAOBAO = ['default',]
#
#if request.controller in IKAIDIAN or request.controller == 'start':
#    " class sip Config for iKaiDian  "
#    APPKEY = '25901'
#    CERTCODE = '6e1ce7a030dc11dea751cefd64740030'
#    SIPSESSIONID = response.session_id  # for web2py
#    APPLICATIONNAME = "爱开店"
#    MY_ALISOFT_URL = 'http://mall.alisoft.com/apps/shopwindow/showAppDetailAction!view.jspa?appID='+APPKEY
#    " instantiation Sip class "
#    sip = Sip(APPKEY, CERTCODE, SIPSESSIONID)
#elif request.controller == ITAOBAO or request.controller == 'start':
#    " class sip Config for taobao  "
#    APPKEY = '16635'
#    CERTCODE = '5894b000a0bf11dd8d3cfee3c21c434f'
#    SIPSESSIONID = response.session_id  # for web2py
#    APPLICATIONNAME = "爱淘宝"
#    MY_ALISOFT_URL = 'http://mall.alisoft.com/apps/shopwindow/showAppDetailAction!view.jspa?appID='+APPKEY
#    " instantiation Sip class "
#    sip = Sip(APPKEY, CERTCODE, SIPSESSIONID)
#else:
#    raise Exception("not request and sip")
